<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css" />
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css" />
    <title>方盛云仓订单详情</title>
</head>
<body data-id="">
<nav class="breadcrumb">订单管理 <span class="c-gray en">&gt;</span> 方盛云仓订单查询 <span class="c-gray en">&gt;</span> 方盛云仓订单详情<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="form-member-add" method="post">
        <div class="bg-1 bk-gray pd-20 mb-20">
            <div class="va-m lh-20 f-16 pb-15">
                <strong>订单状态：<span id="orderState">订单成功</span>
                </strong>
            </div>
            <table>
                <tr>
                    <td class="col-3-1">订单号：<span id="orderId"></span></td>
                    <td class="col-3-1">下单时间：<span id="orderTime"></span></td>
                </tr>
                <tr>
                    <td class="col-3-1" id="relieverole">下单账号：<span id="loginAccount"></span></td>
                </tr>
            </table>
        </div>
        <div class="bg-1 bk-gray pd-20 mb-20">
            <div class="va-m lh-20 f-14 pb-15">
                <strong>基本信息</strong>
            </div>
            <div class="line"></div>
            <div class="pd-20 mb-20">
                <table>
                    <tr>
                        <td class="col-3-l"><span class="f-l">下单账号：</span><span id="loginAccount2"></span></td>
                        <td class="col-3-1"><span class="f-l">手机：</span><span id="phoneNum"></span></td>
                    </tr>
                    <tr>
                        <td class="col-3-1"><span class="f-l">客户名称：</span><span id="customerName"></span></td>
                        <td class="col-3-1"><spadn class="f-l">云仓名称：</spadn><span id="houseName"></span></td>
                    </tr>
                    <tr>
                        <td class="col-3-1"><span class="f-l">云仓地址：</span><span id="houseAddress"></span></td>
                    </tr>

                </table>
            </div>

            <div class="va-m lh-20 f-14 pb-15">
                <strong>支付与配送信息</strong>
            </div>
            <div class="line"></div>
            <div class="pd-20 mb-20">
                <table>
                    <tr>
                    <td class="col-3-1">结算金额：<span id="orderMoney"></span></td>
                    <td class="col-3-1">收获方式：<span id="delivery-method">自提</span></td>
                    <td class="col-3-1">支付方式：<span id="freight">账期支付</span></td>
                    </tr>

                </table>
            </div>
        <div class="pd-20 mb-20">
            <div class="va-m lh-20 f-14 pb-15">
                <strong>商品信息</strong>
            </div>
                <table class="table table-border table-bordered table-hover table-bg table-sort mt-10" id="datatable">
                    <thead>
                    <tr >
                        <th style="width: 300px;">商品</th>
                        <th>售价区域</th>
                        <th>购买数量</th>
                        <th>出库数量</th>
                        <th>收货数量</th>
                        <th>单价</th>
                        <th>小计</th>

                    </tr>
                    </thead>
                    <tbody class="shun">
                    </tbody>
                </table>
            <div class="text-r pd-20">
                <p>商品金额：&yen;<span id="goodsAmount"></span></p>
                <p>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：&yen;<span id="fare">0.00</span></p>
                <p>订单金额：&yen;<span id="orderAmount"></span></p>
            </div>
        </div>
          <!--  <div style="text-align: center;margin-top: 256px">
                <a onclick="cancelBtn()" style="margin-top: -236px;" id="cancelBtn" class="btn btn-secondary radius size-S ml-20">返回</a>
            </div>-->
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/Project.js?rev=@@hash"></script>
<!--权限控制-->
<script type="text/javascript" src="../../../ht-js/power.js?rev=@@hash"></script>
<script>
    fsprepare()
    function fsprepare() {
        $.ajax({
            url:'https://'+ window.location.host +'/api/admin/anobodyhouse/searchOrderDetails',
            cache: false, //禁用缓存
            type: "POST",
            data: {
                orderId:sessionStorage.getItem("sforderId"),
            },
            success: function (data) {
                console.log(data)
                $("#orderId").html(data.data.orderId)
                $("#orderTime").html(data.data.orderTime)
                $("#loginAccount").html(data.data.loginAccount)
                $("#loginAccount2").html(data.data.loginAccount)
                $("#phoneNum").html(data.data.phoneNum)
                $("#customerName").html(data.data.customerName)
                $("#houseName").html(data.data.houseName)
                $("#houseAddress").html(data.data.houseAddress)
                /*$("#orderMoney").html(Math.floor(data.data.orderMoney * 100) / 100)*/
                var f = Math.round(data.data.orderMoney*100)/100;
                var s = f.toString();
                var rs = s.indexOf('.');
                if (rs < 0) {
                    rs = s.length;
                    s += '.';
                }
                while (s.length <= rs + 2) {
                    s += '0';
                }
                $("#orderMoney").html(s)

                $("#goodsAmount").html(s)
                $("#orderAmount").html(s)

                couponlist2(data.data.productList, 0);
            },
            error: function () {
                $.Huimodalalert('失败！',2000);
            }
        });
    }
    var dataSource = new Array();
    //table的数据源
    var table;   //table对象
    dataSource = [];
    function couponlist2(data, index){
        sessionStorage.setItem("authorizedUsers", JSON.stringify(data));
        dataSource.splice(0,dataSource.length);//清空数组
        $.each(data, function (i, field) {
            var rowData = new Array();
            rowData.push(field.productPic);
            rowData.push(field.productName);
            rowData.push(field.wareName);
            rowData.push(field.productNum);
            rowData.push(field.productPrice);
            dataSource.push(rowData);

        });

        initData(dataSource);

        function initData(dataSource) {

            var dttable = $('#datatable').dataTable(); // 初始化dataTable，清空上一个值
            dttable.fnClearTable(); //清空一下table
            dttable.fnDestroy(); //还原初始化了的datatable
            $("#datatable").DataTable({
                "autoWidth": false,
                "ordering": false,
                "searching": false,
                "paging": false,
                "retrieve": false,
                "destroy": true,
                "bAutoWidth": false,
                "bLengthChange": false,
                "aLengthMenu": [20],
                "oLanguage": {
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    },
                    "sZeroRecords": "没有检索到数据",
                },
                data: dataSource,
                columnDefs: [
                    {
                        "visible": true,
                        "targets": 0
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = '<div style="cursor:pointer;"><img onclick="picShow(\'查看图片\',\'picShow.html\',\''+row[0]+'\')"  style="float: left;width: 100px;height: 100px;" name="" src="'+row[0]+'" alt=""><div style="float: left;width:180px;padding-top: 20px;margin-left: 10px;"><div>'+row[1]+'</div></div></div></td>'
                            return val;
                        },
                        "targets": 0
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[2]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 1
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[3]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 2
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[3]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 3
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[3]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 4
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var f = Math.round(row[4]*100)/100;
                            var s = f.toString();
                            var rs = s.indexOf('.');
                            if (rs < 0) {
                                rs = s.length;
                                s += '.';
                            }
                            while (s.length <= rs + 2) {
                                s += '0';
                            }
                            return s;
                        },
                        "targets": 5
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val =( row[4]* row[3] ).toFixed(2)
                            if (val == undefined) {
                                val = ''
                            }

                            return val;
                        },
                        "targets": 6
                    },


                ]
            });
        };
    }

    function picShow(title, url, imgUrl) {
        sessionStorage.setItem("imgUrl", imgUrl);
        layer_show(title, url, "800", "500");
    }
    function cancelBtn() {
        parent.layer.closeAll();
    }
</script>
</body>
</html>